aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/cjson cjson)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/weilaproto weilaproto)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/nanpb nanpb)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/main main)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/crypto crypto)


add_library(protocol STATIC ${weilaproto} ${nanpb} ${main} ${protocol_include} ${cjson} ${crypto})
if(${PROTOCOL_DEBUG_MEM})
    target_compile_definitions(protocol PRIVATE DEBUG_MEM)
endif()

target_include_directories(protocol
        PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/nanpb
                ${CMAKE_CURRENT_SOURCE_DIR}/weilaproto
                ${CMAKE_CURRENT_SOURCE_DIR}/main
        PUBLIC  ${CMAKE_CURRENT_SOURCE_DIR}/include
                ${CMAKE_CURRENT_SOURCE_DIR}/cjson
                ${CMAKE_CURRENT_SOURCE_DIR}/crypto)
